Skip to main content

RealtimeComponent<TModel>

RealtimeComponent<TModel>

A component that synchronizes the state of a RealtimeModel to/from an object in the scene.

Events

ownerIDSelfDidChange

event Action<RealtimeComponent<TModel>, int> ownerIDSelfDidChange

Dispatched when the ownerIDSelf value changes.

Properties

realtimeView

RealtimeView realtimeView { get; }

The RealtimeView that owns this component. Accessing this property before Start is unreliable.

realtime

Realtime realtime { get; }

The Realtime instance that is managing this component. On prefab views, this property is available after Awake. On scene views or their children, this is not available until Start.

room

Room room { get; }

The current room of the Realtime instance that is managing this component. This might be null if the Realtime instance hasn't connected yet. Accessing this property before Start is unreliable.

ownerIDSelf

int ownerIDSelf { get; }

The client ID of the component owner.

ownerIDInHierarchy

int ownerIDInHierarchy { get; }

The client ID of the component's hierarchy owner (the root owner of the component).

isUnownedSelf

bool isUnownedSelf { get; }

True if the component is not owned by any client.

isUnownedInHierarchy

bool isUnownedInHierarchy { get; }

True if the component and all of its parent views are not owned by any client.

isOwnedLocallySelf

bool isOwnedLocallySelf { get; }

True if the component is owned by the local client.

isOwnedLocallyInHierarchy

bool isOwnedLocallyInHierarchy { get; }

True if the component and all of its parent views are owned by the local client.

isOwnedRemotelySelf

bool isOwnedRemotelySelf { get; }

True if the component is owned by a remote client.

isOwnedRemotelyInHierarchy

bool isOwnedRemotelyInHierarchy { get; }

True if this component and all of its parent views are owned by a remote client.

Methods

RequestOwnership

void RequestOwnership()

Request ownership of the component.

SetOwnership

void SetOwnership(int clientID)

Set ownership of the component.

ClearOwnership

void ClearOwnership()

Clear ownership of the component.